import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/team',
    name: 'Team',
    component: () => import(/* webpackChunkName: "team" */ '../views/Team.vue')
  },
  {
    path: '/teamdetail/:id',
    name: 'TeamDetail',
    props:true,
    component: () => import(/* webpackChunkName: "teamDetail" */ '../views/TeamDetail.vue')
  },
  {
    path: '/detail/:id/:date',
    name: 'TravelDetail',
    props:true,
    component: () => import(/* webpackChunkName: "traveDetail" */ '../views/TravelDetail.vue')
  },
  {
    path: '/selected/:keyword',
    name: 'Selected',
    props:true,
    component: () => import(/* webpackChunkName: "selected" */ '../views/Selected.vue')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import(/* webpackChunkName: "register" */ '../views/Register.vue')
  },
  {
    path: '/strategy',
    name: 'Strategy',
    component: () => import(/* webpackChunkName: "strategy" */ '../views/Strategy.vue')
  },
  {
    path: '/strategydetail/:mid',
    name: 'StrategyDetail',
    props:true,
    component: () => import(/* webpackChunkName: "strategydetail" */ '../views/StrategyDetail.vue')
  },
 
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (to) {
  return VueRouterPush.call(this, to).catch(err => err)
}

export default router
